package com.songtai.service.impl;

import com.songtai.dao.IntroduceDao;
import com.songtai.po.Introduce;
import com.songtai.service.IntroduceService;

/**
 * @author 赵中杨
 * @email zhaozhongyang717@gmail.com
 * @date 2010 2010-4-20 下午04:23:45
 */
public class IntroduceServiceImpl implements IntroduceService {
	private IntroduceDao introduceDao;

	@Override
	public void addIntroduce(Introduce introduce) {
		introduceDao.addIntroduce(introduce);
	}

	@Override
	public Introduce getIntroduceByNid(Long nodeid) {
		return introduceDao.getIntroduceByNid(nodeid);
	}

	@Override
	public void updateIntroduce(Introduce introduce) {
		Introduce intro = introduceDao.getIntroduceById(introduce.getId());
		if (intro != null) {
			intro.setContent(introduce.getContent());
			introduceDao.updateIntroduce(intro);
		}
	}

	/**
	 * @return the introduceDao
	 */
	public IntroduceDao getIntroduceDao() {
		return introduceDao;
	}

	/**
	 * @param introduceDao
	 *            the introduceDao to set
	 */
	public void setIntroduceDao(IntroduceDao introduceDao) {
		this.introduceDao = introduceDao;
	}

}
